<template>

    <div>


        <!--<section class="products text-center">
        我是评论你组件<br/>
		<div class="container">
			<template>
				<el-table
				:data="contentlist"
				style="width: 100%">
				<el-table-column
					prop="create_time"
					label="评论时间"
					width="180">
				</el-table-column>
				<el-table-column
					prop="uid"
					label='用户'
					width="180">
				</el-table-column>
				<el-table-column
					prop="content"
					label="评论内容">
				</el-table-column>
				</el-table>
			</template>
		</div>
	</section>-->
    <section class="products text-center">
		<div class="container">
			<ul>
				<li v-for="item in contentlist">
					{{ item.uid | myfilter }}  :  {{ item.content }}

				</li>
			</ul>
		</div>
	</section>
    </div>



</template>


<script>
import {config} from '../config.js'

export default {
  data () {
    return {
      msg: "这是一个变量",

    }
  },
  props:['contentlist','myuser'],
  mounted:function(){

    },
  methods:{
      //格式化
      get_username(uid){
          return this.myuser[uid]
      }
    },
  //在渲染之前定义that变量
  beforeCreate(){
		window.that=this;
	},
  //自定义过滤器
  filters:{
		//自定义方法
		myfilter:function (value) {
			//通过key(用户id)获取用户名
			return window.that.myuser[value]
		}
	},
}


</script>



<style>

</style>
